package org.timemachine.context;

public class TMScheduleThreadLocal {

	public static final ThreadLocal<ScheduleContext> userThreadLocal = new ThreadLocal<ScheduleContext>();

	public static void set(ScheduleContext context) {
		userThreadLocal.set(context);
	}

	public static void unset() {
		userThreadLocal.remove();
	}

	public static ScheduleContext get() {
		if (userThreadLocal.get() == null) {
			userThreadLocal.set(new ScheduleContext());
		}
		return userThreadLocal.get();
	}

}
